package com.cherrypt.api.model.bo;

import com.cherrypt.api.model.dataobject.Series;
import com.cherrypt.api.model.dto.SeriesDto;
import com.cherrypt.api.model.dto.TorrentDto;
import com.cherrypt.api.model.util.BeanUtils;

import java.util.List;

/**
 * @Author: intent
 * @Date: 19-10-28 下午1:54
 */
public class SeriesBo {
    public static SeriesDto getSeriesDto(Series series, List<TorrentDto> torrentDtoList) {
        SeriesDto seriesDto = new SeriesDto();
        BeanUtils.copyFieldToBean(series, seriesDto);
        if (torrentDtoList.size() > 0) {
            seriesDto.setTorrentList(torrentDtoList);
        }
        return seriesDto;
    }
}
